package com.qingcheng.entity;


import com.qingcheng.pojo.order.Order;

import java.io.Serializable;
import java.util.List;

/**
 * 分页结果
 * @param <T>
 */
public class PageResult<T> implements Serializable {

    private Long total;//返回记录数
    private List<T> rows;//结果
    private int pages;//总页数
    private int pageNum;//当前页
    private int size;//每页显示数量

    public PageResult(Long total, List<T> rows, int pages, int pageNum, int size) {
        this.total = total;
        this.rows = rows;
        this.pages = pages;
        this.pageNum = pageNum;
        this.size = size;
    }

    public PageResult(Long total, List<T> rows, int pages) {
        this.total = total;
        this.rows = rows;
        this.pages = pages;
    }

    public int getPages() {
        return pages;
    }

    public void setPages(int pages) {
        this.pages = pages;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    //    private Page page;

//    public Page getPage() {
//        return page;
//    }

//    public PageResult(Long total, List<T> rows, Page page) {
//        this.total = total;
//        this.rows = rows;
//        this.page = page;
//    }

//    public void setPage(Page page) {
//        this.page = page;
//    }

    public PageResult(Long total, List<T> rows) {
        this.total = total;
        this.rows = rows;
    }

    public PageResult(long total, List<Order> result, int pages, int page, int size) {
    }

    public Long getTotal() {
        return total;
    }

    public List<T> getRows() {
        return rows;
    }

    public void setRows(List<T> rows) {
        this.rows = rows;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

}
